﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AdvancedCShardFeatures
{
    static class StringBuilderExtension
    {
        public static string Substring(this StringBuilder builder, int to)
        {
            string builderString = builder.ToString();
            string substring = builderString.Substring(to);
            return substring;
        }

        public static string Substring(this StringBuilder builder, int from, int length)
        {
            string builderString = builder.ToString();
            string substring = builderString.Substring(from, length);
            return substring;
        }

        static void Main(string[] args)
        {
            StringBuilder builder = new StringBuilder();
            builder.Append("this is my f builder");
            string substring = builder.Substring(7);
            string original = builder.ToString().Substring(7);
            Console.WriteLine(substring + " - " + original);


            substring = builder.Substring(5, 10);
            original = builder.ToString().Substring(5, 10);
            Console.WriteLine(substring);
            Console.WriteLine(original);
        }
    }
}
